home *** CD-ROM | disk | FTP | other *** search
/ My Neighborhood / My Neighborhood.iso / mac / MacFiles / FarmGoos.Dxr / 00005.ls < prev    next >
Encoding:
Text File  |  1997-11-18  |  2.7 KB  |  87 lines

  1. on exitFrame
  2.   global snap, tempH, tempV, snapH, snapV, lastClickOn
  3.   if (the locH of sprite lastClickOn > (snapH - 25)) and (the locH of sprite lastClickOn < (snapH + 25)) and ((the locV of sprite lastClickOn > (snapV - 25)) and (the locV of sprite lastClickOn < (snapV + 25))) then
  4.     if snap = 0 then
  5.       set tempH to the mouseH
  6.       set tempV to the mouseV
  7.       puppetSound("synthdrip.s")
  8.     end if
  9.     set the visible of sprite 14 to 1
  10.     set snap to 1
  11.     if (the mouseH > (tempH - 25)) and (the mouseH < (tempH + 25)) and ((the mouseV > (tempV - 25)) and (the mouseV < (tempV + 25))) then
  12.       set the locH of sprite lastClickOn to snapH
  13.       set the locV of sprite lastClickOn to snapV
  14.     else
  15.       set the locH of sprite lastClickOn to the mouseH
  16.       set the locV of sprite lastClickOn to the mouseV
  17.     end if
  18.     updateStage()
  19.   else
  20.     set snap to 0
  21.     set the visible of sprite 14 to 0
  22.     set the locH of sprite lastClickOn to the mouseH
  23.     set the locV of sprite lastClickOn to the mouseV
  24.   end if
  25.   updateStage()
  26.   go(the frame)
  27. end
  28.  
  29. on mouseUp
  30.   global follow, snap, lastClickOn, homeV, homeH, snapH, snapV, lastOver
  31.   set follow to 0
  32.   if snap = 1 then
  33.     set the locH of sprite lastClickOn to snapH
  34.     set the locV of sprite lastClickOn to snapV
  35.     updateStage()
  36.     wait(20)
  37.     if the name of cast the castNum of sprite lastClickOn = "goose" then
  38.       hatchEgg()
  39.       puppetSound("toots.s")
  40.       updateStage()
  41.       wait(20)
  42.       go(the frame + 1)
  43.     else
  44.       hatchEgg()
  45.       set the visible of sprite 14 to 0
  46.       set the visible of sprite (lastClickOn - 6) to 1
  47.       set the visible of sprite lastClickOn to 0
  48.       set the castNum of sprite lastClickOn to the castNum of sprite lastClickOn - 1
  49.       set the locH of sprite lastClickOn to homeH
  50.       set the locV of sprite lastClickOn to homeV
  51.       puppetSound("swiper.s")
  52.       updateStage()
  53.       wait(20)
  54.       set lastOver to 0
  55.       go(the frame - 1)
  56.     end if
  57.   else
  58.     puppetSound("swipe.s")
  59.     set the visible of sprite 14 to 0
  60.     set the visible of sprite (lastClickOn - 6) to 1
  61.     set the visible of sprite lastClickOn to 0
  62.     set the castNum of sprite lastClickOn to the castNum of sprite lastClickOn + 1
  63.     set the locH of sprite lastClickOn to homeH
  64.     set the locV of sprite lastClickOn to homeV
  65.     updateStage()
  66.     wait(20)
  67.     set lastOver to 0
  68.     go(the frame - 1)
  69.   end if
  70. end
  71.  
  72. on hatchEgg
  73.   global lastClickOn
  74.   puppetSound("eggcrack.s")
  75.   updateStage()
  76.   repeat while soundBusy(1)
  77.   end repeat
  78.   if lastClickOn = 13 then
  79.     set the visible of sprite 15 to 1
  80.   end if
  81.   set the castNum of sprite lastClickOn to the castNum of sprite lastClickOn + 2
  82.   puppetSound("egg" & lastClickOn - 6)
  83.   updateStage()
  84.   wait(120)
  85.   set the visible of sprite 15 to 0
  86. end
  87.